# Maintainer: Steven Guikal <void@fluix.one>
pkgname=py3-email-validator
_pkgname=python-email-validator
pkgver=2.1.0
pkgrel=0
pkgdesc="A robust email syntax and deliverability validation library"
url="https://github.com/JoshData/python-email-validator"
arch="noarch"
license="CC0-1.0"
depends="py3-idna"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-dnspython
	py3-pytest
	"
subpackages="$pkgname-pyc"
install="$pkgname.post-upgrade"
source="$pkgname-$pkgver.tar.gz::https://github.com/JoshData/$_pkgname/archive/v$pkgver.tar.gz"
builddir=$srcdir/$_pkgname-$pkgver

replaces="py-email-validator" # Backwards compatibility
provides="py-email-validator=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
d285404f6735e0cd33385060c483a4dd4e12ace4b2e7027f8cd360901bc640ae999eb5d3ec2b98530e53af48f8e6c180d65cb53eec4de5a1617149ab76027901  py3-email-validator-2.1.0.tar.gz
"
